import axios from './axios.js';

const $post = (url, param) => {
  return axios.post(url, param);
};

const $get = (url) => {
  return axios.get(url);
};

const $put = (url, param) => {
  return axios.put(url, param);
};

const $delete = (url) => {
  return axios.delete(url);
};

const httpPlugin = {
  install(app) {
    app.provide('$post', $post);
    app.provide('$get', $get);
    app.provide('$put', $put);
    app.provide('$delete', $delete);
  }
};

export default httpPlugin;
